<!-- 胡晨倩 -->
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>修改密码</title>
<link rel="stylesheet" type="text/css"
	href="../js/util/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="../js/util/easyui/themes/icon.css">

<script type="text/javascript" src="../js/util/easyui/jquery.min.js"></script>
<script type="text/javascript"
	src="../js/util/easyui/jquery.easyui.min.js"></script>

<link href="../css/css.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="../js/index/change.js"></script>
</head>
<body>
	<div style="margin-top: 20px; margin-left: auto;"></div>
	<div class="easyui-panel" title="Change Password"
		style="width: 100%; max-width: 400px; padding: 30px 60px;">
		<form id="tt" method="post" action="../ChangePasswordServlet">
			<div style="margin-bottom: 20px">
				<input class="easyui-passwordbox" name="passwordold"
					style="width: 100%" data-options="label:'原密码:',required:true">
			</div>
			<div style="margin-bottom: 20px">
				<input class="easyui-passwordbox" name="password" id="password"
					style="width: 100%"
					data-options="label:'新密码:',required:true,validType:'password'"
					prompt="密码必须包含大小写英文和数字空格">
			</div>
			<div style="margin-bottom: 20px">
				<input class="easyui-passwordbox" name="password2" id="password2"
					style="width: 100%"
					data-options="label:'确认密码:',required:true,validType:'password2'"
					prompt="两次密码必须一致">
			</div>
			<a href="javascript:void(0)" class="easyui-linkbutton"
				onclick="clearForm()" style="width: 80px">重置</a> &nbsp;&nbsp;&nbsp;
			<button id="sub" class="easyui-linkbutton" type="submit" style="width: 80px">修改</button>
		</form>
	</div>
	<script>
		function clearForm() {
			$('#tt').form('clear');
		}
		
		$.extend($.fn.validatebox.defaults.rules,{
			password:{
				validator:function(value,param){
					return /^(?=.*[0-9].*)(?=.*[a-z].*)(?=.*[A-Z].*)(?=.*\s.*).{6,30}$/gi.test(value);
				},
				message:"必须包含大小写字母，数字和空格"
			},
			password2:{
				validator:function(value,param){
					return value == $("password").val(); 
				},
				message:"密码输入不一致"
			}
		});

	</script>
</body>
</html>